<%= render :partial => 'admin/items/left_bar', :locals => { :on => 1 } %>
<div id="main">
  <div id="cat1" class="box fl" style="width:300px; margin-right:20px">
		<table class="border table">
			<tr>
				<th nowrap="nowrap">序号</th>
				<th width="80">淘宝分类</th>    
				<th width="80">一级分类</th>
				<th align="right">操作</th>
			</tr>
			<%for cat1 in @cat1%>
			<tr class="<%= cycle('', 'tr2') %>">
				<td><%=cat1.id%></td>
				<td><%=cat1.t_cat_name%></td>
				<td><a href="/admin/item_categories?cid1=<%=cat1.id%>" class="<%= cat1.id.to_s == params[:cid1] ? 'highlight' : '' %>"><%=cat1.view_name%></a></td>		
				<td align="right" nowrap="nowrap"><%=link_to "修改", {:action => "edit", :id => cat1}, :class => "btt"%><%=link_to("删除", {:action => "destroy", :id => cat1 },
  :confirm => "Are you sure you want to delete this category?",
  :method => :delete, :class => "btt")%></td>
				</tr>
			<%end%>
		 </table>
	 </div>
    <div class="box fl" style="width:300px;margin-right:20px; margin-top:20px">
		  <table class="border table">
			<tr>
				<th nowrap="nowrap">序号</th>
				<th width="80">淘宝分类</th>
				<th width="80">二级分类</th>
				<th align="right">操作</th>    
			</tr>
			<%unless @cat2.blank?%>
				<%for cat2 in @cat2%>
				<tr class="<%= cycle('', 'tr2') %>">
				<td><%=cat2.id%></td>
				<td><%=cat2.t_cat_name%></td>
				<td><a href="/admin/item_categories?cid1=<%=params[:cid1]%>&cid2=<%=cat2.id%>" class="<%= cat2.id.to_s == params[:cid2] ? 'highlight' : '' %>"><%=cat2.view_name%></a></td>		
				<td align="right" nowrap="nowrap"><%=link_to "修改", {:action => "edit", :id => cat2}, :class => "btt"%><%=link_to("删除", {:action => "destroy", :id => cat2 },
  :confirm => "Are you sure you want to delete this category?",
  :method => :delete, :class => "btt")%></td>
				</tr>
			<%end%>
			<%end%>
		</table>
	 </div>
	 <div class="box fl" style="width:300px;  margin-right:20px; margin-top:40px">
		 <table class="border table">
			<tr>
				<th nowrap="nowrap">序号</th>
				<th width="80">淘宝分类</th>    
				<th width="80">三级分类</th>
				<th align="right">操作</th>    
			</tr>
			<%unless @cat3.blank?%>
				<%for cat3 in @cat3%>
				<tr class="<%= cycle('', 'tr2') %>">
					<td><%=cat3.id%></td>
					<td><%=cat3.t_cat_name%></td>
					<td><a href="/admin/item_categories?cid1=<%=params[:cid1]%>&cid2=<%=params[:cid2]%>&cid3=<%=cat3.id%>" class="<%= cat3.id.to_s == params[:cid3] ? 'highlight' : '' %>"><%=cat3.view_name%></a></td>
					<td align="right" nowrap="nowrap"><%=link_to "修改", {:action => "edit", :id => cat3}, :class => "btt"%><%=link_to("删除", {:action => "destroy", :id => cat3 },
  :confirm => "Are you sure you want to delete this category?",
  :method => :delete, :class => "btt")%>
</td>
				</tr>
				<%end%>
			<%end%>
			</table>
		</div>
 </div>
